
/**
 *@des 待办流程相关接口
 *@author yiiframe 21931118@qq.com
 *@blog http://www.yiiframe.com
 *@date 2019/1/1 07:25:00
 *@param approve.js
 */

import request from './request.js'

// 查询我的待办
export function todoList(data) {
  return request({
    url: '/workspace/process/toDoList',
    method: 'POST',
    data
  })
}

// 查询我发起的
export function applyList(data) {
  return request({
    url: '/workspace/process/applyList',
    method: 'POST',
    data
  })
}

// 查询关于我的
export function doneList(data) {
  return request({
    url: '/workspace/process/doneList',
    method: 'POST',
    data
  })
}

// 查询抄送我的
export function ccList(data) {
  return request({
    url: '/workspace/process/ccList',
    method: 'POST',
    data
  })
}
// 查询流程详情
export function getProcessInstanceInfo(data) {
  return request({
    url: '/workspace/process/instanceInfo',
    method: 'POST',
    data: data
  })
}
/**
 * 查询一个流程的历史
 */
export function processHistory(processInstanceId) {
  return request({
    url: `/workspace/history/${processInstanceId}`,
    method: 'get'
  })
}

/**
 * 流程操作
 */

// 同意
export function agree(data) {
  return request({
    url: '/workspace/agree',
    method: 'POST',
    data: data
  })
}
//  拒绝,驳回
export function refuse(data) {
  return request({
    url: '/workspace/refuse',
    method: 'POST',
    data: data
  })
}
// 撤回
export function revoke(data) {
  return request({
    url: '/workspace/revoke',
    method: 'POST',
    data: data
  })
}




// 采购金额审批：其他供应商价格
export function getPurchasemoney(data) {
  return request({
    url: `/purchasemoney/supplier`,
    method: 'post',
    data: data
  })
}

// 采购金额审批：获取其他申请的物料信息
export function getItemSupplier(param) {
  return request({
    url: '/material/getItemSupplier',
    method: 'get',
    data: param
  })
}

// 采购金额审批：获取其他申请的物料价格
export function getOtherPrice(param) {
  return request({
    url: '/purchasemoney/history',
    method: 'get',
    data: param
  })
}

// 供应商白名单：获取供应商列表
export function getMaterialList(itemId) {
  return request({
    url: `/material/materialbysupply/V1?materialGuId=${itemId}`,
    method: 'post'
  })
}

